<?php

	// check login
	$fall_login_flag = false;

	//  	$pClsAdminCP->setSession();
	//$_SERVER['QUERY_STRING'] =='login' && 
	

	if($_SERVER['QUERY_STRING'] =='logout')
		$pClsUserLogin->doLogOut();

	if(!$pClsUserLogin->confirmSession())
	{
		?>		
		<table cellpadding="0" cellspacing="0" border="1" class="bda7a7a9" bgcolor="#fc2ed0">
			<tr>
				<td class="w300 h31 lr_menu" style="cursor:pointer" align="center">
					THÔNG TIN ĐĂNG NHẬP
				</td>
			</tr>
		</table>
		<table cellpadding="0" cellspacing="0" border="1" class="bda7a7a9" bgcolor="#ffe6df">
			<tr>
				<td class="w300" >
					<? 
						$url = $_SERVER['REQUEST_URI'];
						if(!strstr($url, '?'))
							$url .= "?loginmode=quicklogin";
						else $url .= "&loginmode=quicklogin";
					?>
					<form method="post" action="<? echo($url); ?>" onsubmit = "return loginformFormCheck()" enctype="multipart/form-data">
						<table cellspacing="0" cellpadding="0" border = "0">
							<tr>
    							<td class="h30 w200">
        							<table cellspacing="0" cellpadding="10" border="0">
										<tr>
    										<td class="h30 w80" align="right" style="padding:0px 5px;font-size:11px">
        										<strong>Tài khoản</strong>
											</td> 
											<td style="padding:0px 10px" width="auto">
												<input type="text" name="quickusername" id="quickusername" size = "20" style="" maxlength="50" value="" />
											</td>
										</tr>
										<tr>
    										<td class="h30 w80" align="right" style="padding:0px 5px;font-size:11px">
        										<strong>Mật khẩu</strong>
											</td> 
											<td style="padding:0px 10px" width="auto">
												<input type="password" name="quickpassword" id="quickpassword" size="20" value = ""   />
												
											</td>
										</tr>
									</table>
								</td> 
								<td class="h30 w100">
									<button class="ui-corner-all ui-mybutton" type="submit">Đăng nhập</button>
								</td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>
		<div class="h10"></div>
	
		<?
	}
	else
	{
		$username = $pClsUserLogin->getSession();
		require_once('includes/user.tbl.php');
		$pClsUser = new clsUserTable();
		$pClsUser->load($username);
		
		?>
		<table cellpadding="0" cellspacing="0" border="1" class="bda7a7a9" bgcolor="#fc2ed0">
			<tr>
				<td class="w300 h31 lr_menu" style="cursor:pointer" align="center">
					THÔNG TIN ĐĂNG NHẬP
				</td>
			</tr>
		</table>
		<table cellpadding="0" cellspacing="0" border="1" class="bda7a7a9" bgcolor="#ffe6df">
			<tr>
				<td class="w300" >
					<table cellspacing="0" cellpadding="0" border = "0">
						<tr>
							<td class="w300">
    							<table cellspacing="0" cellpadding="5" border="0">
									<tr>
										<td class="h30 w300" style="padding:0px 5px;font-size:11px">    										
										<span class="lr_menu_item"><strong>Xin chào: </strong><? echo($pClsUser->value('name')); ?></span>
										</td>
									</tr>
									<tr>
										<td class="h30 w300" align="right">
											<? 
												$url = $_SERVER['REQUEST_URI'];
												if(!strstr($url, '?'))
													$url .= "?loginmode=quicklogout";
												else $url .= "&loginmode=quicklogout";
											?>
											<span><a href="">Thông tin</a> | <a href="<? echo($url); ?>">Thoát</a></span>
										</td>
									</tr>
								</table>
							</td> 
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<div class="h10"></div>
		<?
	}
?>

